<template>
  <div id="personal" style="background: #fff">
    <div class="leftMeun">
      <el-menu
        default-active="learning"
        @select="selectmenu"
        class="el-menu-vertical-demo"
      >
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-s-management"></i>
            <span style="font-size: 16px; font-weight: 600; color: #333"
              >学习中心</span
            >
          </template>
          <el-menu-item index="learning">
            <span style="font-size: 16px">我的学习</span>
          </el-menu-item>
          <el-menu-item index="course">
            <span style="font-size: 16px">我的课程</span>
          </el-menu-item>
          <el-menu-item index="exam">
            <span style="font-size: 16px">我的考试</span>
          </el-menu-item>
          <el-menu-item index="questionnaireWrite">
            <span style="font-size: 16px">问卷填报</span>
          </el-menu-item>
          <el-menu-item index="practice">
            <span style="font-size: 16px">答题练习</span>
          </el-menu-item>
          <el-menu-item index="certificate"
            ><span style="font-size: 16px"> 我的证书 </span></el-menu-item
          >
        </el-submenu>

        <el-submenu index="2">
          <template slot="title">
            <i class="ym-custom ym-custom-message-text-outline"></i>
            <span style="font-size: 16px; font-weight: 600; color: #333"
              >互动中心</span
            >
          </template>
          <el-menu-item index="comment">
            <span style="font-size: 16px">我的评论</span>
          </el-menu-item>
          <el-menu-item index="star">
            <span style="font-size: 16px">我的点赞</span>
          </el-menu-item>
          <el-menu-item index="favorite">
            <span style="font-size: 16px">我的收藏</span>
          </el-menu-item>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-s-order"></i>
            <span style="font-size: 16px; font-weight: 600; color: #333"
              >教务管理</span
            >
          </template>
          <el-menu-item index="examReview">
            <span style="font-size: 16px">考试批阅</span>
          </el-menu-item>
          <el-menu-item index="homeworkReview">
            <span style="font-size: 16px">作业批阅</span>
          </el-menu-item>
        </el-submenu>
      </el-menu>
    </div>
    <component
      :is="layoutType"
      style="width: 955px; height: 100%; minheight: 800px; background: #fff"
    />
  </div>
</template>

<script>
import learning from "./pages/learning";
import exam from "./pages/exam";
import course from "./pages/course";
import certificate from "./pages/certificate";
import star from "./pages/interact/star";
import favorite from "./pages/interact/favorite";
import comment from "./pages/interact/comment";
import examReview from "@/views/exam/review";
import homeworkReview from "@/views/tems/course/studyhomework";
import questionnaireWrite from "@/views/questionnaire/questionnaire-write";

import practice from "./pages/practice";
export default {
  name: "personal",
  data() {
    return {
      layoutType: "learning",
    };
  },
  components: {
    learning,
    exam,
    course,
    certificate,
    star,
    favorite,
    comment,
    examReview,
    homeworkReview,
    questionnaireWrite,
    practice,
  },
  mounted() {},
  beforeDestroy() {},
  methods: {
    selectmenu(key) {
      this.layoutType = key;
    },
  },
};
</script>

<style lang="scss" scoped>
.leftMeun {
  width: 225px;
  float: left;
  margin-top: 20px;
  margin-right: 20px;
}

.el-menu-vertical-demo {
  padding: 8px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px 0 hsla(0, 0%, 58%, 0.1);
  min-height: 500px;
}

#personal {
  width: 1200px;
  margin: 0 auto;
}
</style>
